home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
3.1
/
toasterall
/
arexx_examples
/
tpaint
/
embosspic.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-09-09
|
4KB
|
106 lines
/* EmbossPic.rexx Make embossed look image from ToasterPaint screen */
/* By Arnie Cachelin © 1992 NewTek Inc */
/* 02 Jan 1992 At 10:52:01 */
/*
This program will make an 'embossed' version of whatever image is currently
in ToasterPaint. It works by blending the picture with a negative version of
itself, with a small offset. If picture filenames are given, pictures will be
loaded and even saved. This process uses a brush the size of the whole screen,
and this uses a bunch of memory. To help conserve memory, the program deletes
the swap screen with the 'Dswa' command.
*/
ARG iffname outname
centerx=376
centery=240
offset=3
Address "DigiPaint" /* Tell ARexx where commands go */
if iffname~="" Then Call LoadRGB(iffname)
call BWscreen() /* This works better with a black and white image */
'Blu2' /* Heavy Blur (Optional) takes a while huh */
'Whsc' /* Do to whole screen */
'Blu2' /* Heavy Blur (Optional) takes a while huh */
'Whsc' /* Do to whole screen */
'Blu2' /* Heavy Blur (Optional) */
'Whsc' /* Do to whole screen */
'Bdel' /* Delete Swap brush */
'Dswa' /* Delete Swap screen (not needed, helps with low memory */
'Dotb' /* 1 pixel Brush */
'Scis' /* Brush cutter */
'Drre' /* Draw rectangles */
'Whsc' /* Do to whole screen */
'Bcop' /* Copy current brush to Swap brush */
call negativescreen() /* Make the screen negative */
'Hvof' /* Blend gradient off (center=edge) */
'Midc' /* Set center blend to mid way (50% transparency) */
'Pmcl' /* Normal paint mode */
'Bres' /* restore brush from swap brush */
'Pend' centerx+offset centery+offset /* Plant brush with slight offset */
'Penu' centerx+offset centery+offset
'Shco' /* render to composite out */
if outname~="" Then SaveRGB(outname) /* Optional file save */
'Maxc' /* Set center blend back to 100% opacity) */
'Bdel' /* Delete Swap brush .. it's polite to clean up after oneself */
exit
NegativeScreen: Procedure /* Make screen its negative */
'Hvof' /* Blend gradient off (center=edge) */
'Maxc' /* Set center blend to mid way */
'Drre' /* Draw rectangles */
'Flon' /* Fill On */
'8rgb' 255 255 255 /* White color */
'Pmxo' /* XOR mode */
'Whsc' /* Do to whole screen */
'Flof' /* Fill Off */
return 0
BWScreen: Procedure /* Make screen Black and White */
'Hvof' /* Blend gradient off (center=edge) */
'Maxc' /* Set center blend to mid way */
'Drre' /* Draw rectangles */
'Flon' /* Fill On */
'8rgb' 255 255 255 /* White color */
'Pmco' /* Colorize mode */
'Whsc' /* Do to whole screen */
'Flof' /* Fill Off */
return 0
SetFile: PROCEDURE /* Select file in current requester */
arg file
dirname=GetPathName(file)
'Dnam'dirname /* Enter file path */
'Dsel' /* Hit return on directory */
filename=GetFileName(file)
'Fnam'filename /* Enter File name */
'Okls' /* Hit the OK button */
return
SaveRGB: PROCEDURE /* Load Brush, copy into swap buffer */
arg filename
'Sa24' /* Call file requester */
Call SetFile(filename)
return
LoadRGB: PROCEDURE /* Load Brush */
arg filename
'Lo24' /* Call file requester */
Call SetFile(filename)
return
GetFileName: procedure /* Extract file name from full file specification */
ARG fullfile
c = lastpos("/",fullfile)
if c = 0 then c = lastpos(":",fullfile)
return substr(fullfile, c + 1)
GetPathName: procedure /* Extract directory name from full file specification */
ARG fullfile
c = lastpos("/",fullfile)
if c = 0 then c = lastpos(":",fullfile)
return left(fullfile,c)